import http from './public'
let host = 'http://127.0.0.1:8000/api'

// 登陆
export const userLogin = (params) => {
  // return http.fetchPost(host + '/api-token-auth/ ', params)
  return http.fetchPost(host + '/jwt-token-auth/ ', params)
}
// 退出登陆
export const loginOut = (params) => {
  return http.fetchGet('/account/login_out', params)
}
// 用户信息
export const userInfo = (params) => {
  return http.fetchGet(host + '/user/' + params)
}
// 注册账号
export const register = (params) => {
  return http.fetchPost(host + '/user/', params)
}
// 上传图片
export const upload = (params) => {
  return http.fetchPatch(host + '/user/' + params.username + '/', params)
}
// 修改头像
export const updateheadimage = (params) => {
  return http.fetchPost('/account/update_head_image', params)
}
// 捐赠列表
export const thanksList = (params) => {
  return http.fetchGet('/member/thanks', params)
}
// 首页接口
export const productHome = (params) => {
  return http.fetchGet(host + '/home/', params)
}
// 导航栏
export const navList = (params) => {
  // return http.fetchGet('/site/navList', params)
  return http.fetchGet(host + '/home/navList/', params)
}
// 推荐板块
export const recommend = (params) => {
  return http.fetchGet('/goods/recommend', params)
}
// 捐赠板块
export const thank = (params) => {
  return http.fetchGet('/goods/thank', params)
}
// 极验验证码
// export const geetest = (params) => {
//   return http.fetchGet('/member/geetestInit?t=' + (new Date()).getTime(), params)
// }

